package ilender.facebook;

import lombok.*;

/**
 * Base Handler for Facebook objects.
 */
public abstract class FBObject{
	public final long id;
	public final GraphAPI graphAPI;

	/**
	 * Constructor.
	 *
	 * @param graphAPI The owner GraphAPI object.
	 * @param id The Facebook id of the object.
	 */
	FBObject(GraphAPI graphAPI,long id){
		this.graphAPI=graphAPI;
		this.id=id;
	}

	/**
	 * Creates a handler for making a post on facebook.
	 *
	 * @param type The type of the post.
	 * @return The post-making handler.
	 */
	public FBPost postTo(FBPostType type){
		return new FBPost(this,type);
	}
}
